package com.netdisk.entity;

/**
 * 日志类
 * @author chenlong
 *2013-4-13
 */
public class Log extends BaseNetdiskEntity{
	
	private String id;
	
	//动作: 
	//1登陆, 2添加,  3 删除, 4修改, 
	//user:1,2,3,4 
	//group: 12,13,14
	//company:22,23,24
	//fileSystem:32,33,34
	//capcity 42
	//log 53
	private byte action;
	
	
	private String  userId;
	
	private String userName;
	
	private String groupId;
	
	private String groupName;
	
	//日志的时间
	private long date;
	
	//用户修改登陆的ip //当action为登陆的时候才记录
	private String ip;

	public String  getId() {
		return id;
	}

	public  void setId(String id) {
		this.id = id;
	}

	public byte getAction() {
		return action;
	}

	public void setAction(byte action) {
		this.action = action;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public long getDate() {
		return date;
	}

	public void setDate(long date) {
		this.date = date;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
	public Log(){}
	
	/**
	 * 企业级客户用户
	 * 保存的日志,
	 * @param companyId
	 * @param companyName
	 * @param userId
	 * @param userName
	 * @param action
	 * @param date
	 * @param ip
	 */
	public Log(String id, String companyId, String companyName,String userId, 
			String userName, byte action, long date, String ip) {
		this.id = id;
		this.companyId = companyId;
		this.companyName = companyName;
		this.action = action;
		this.userId = userId;
		this.userName = userName;
		this.date = date;
		this.ip = ip;
	}
	
	/**
	 * 用于新增组记录
	 * @param companyId
	 * @param companyName
	 * @param action
	 * @param groupId
	 * @param groupName
	 * @param date
	 * @param ip
	 */
	public Log(String id, String companyId, String companyName, byte action, String groupId,
			String groupName, long date, String ip) {
		this.id = id;
		this.companyId = companyId;
		this.companyName = companyName;
		this.action = action;
		this.groupId = groupId;
		this.groupName = groupName;
		this.date = date;
		this.ip = ip;
	}
	
	/**
	 *单用户的构造函数 
	 * @param action
	 * @param userId
	 * @param userName
	 * @param date
	 * @param ip
	 */
	public Log(String id, byte action, String userId, String userName, long date, String ip) {
		super();
		this.id = id;
		this.action = action;
		this.userId = userId;
		this.userName = userName;
		this.date = date;
		this.ip = ip;
	}
	

	@Override
	public String toString() {
		return "Log [id=" + id + ", companyId" + getCompanyId() + ",companyName" + getCompanyName() + ", action=" + action + ", userId=" + userId
				+ ", userName=" + userName + ", groupId=" + groupId
				+ ", groupName=" + groupName + ", date=" + date + ", ip="
				+ ip + "]";
	}
	
}
